package com.purang.web.view;

import com.purang.web.annotation.Permission;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

public class WebServlet extends HttpServlet {

    @Override
    @Permission(value = {"read"},uri = "/login")
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String username = req.getParameter("username");
        String password = req.getParameter("password");
        resp.setContentType("text/html");
        resp.getWriter().print("<h1>" + username + "</h1>");
        resp.getWriter().print("<h1>" + password + "</h1>");
    }
}
